<?php
/**
 * 店铺首页
 * User: E 房cms www.fangcms.com
 * Date: 2015/1/20
 * Time: 10:51
 */
namespace Wap\Controller;
use Org\Yike\FangCms;
class StoreController extends CommonController{
    public function _initialize(){
        parent::_initialize();
        $store_left = getStoreLeft();
        if(!$store_left['store']){
            $this->error('找不到对应的店铺信息');
        }
        $this->store = $store_left['store'];
        $this->store_user = $store_left['store_user'];
    }

    public function index(){
        $FangCms = new FangCms();
        $FangCms->setInc($this->store['id'],'store');
        $store = $this->store;
        $store['title'] = $store['seo_title'] ? $store['seo_title'] : $store['name'];
        //会员房源
        $where = array('status'=>1,'user_id'=>$this->store['user_id']);
        $this->used_list = M('used')->where($where)->order('id desc')->limit(5)->select();
        $this->rental_list = M('rental')->where($where)->order('id desc')->limit(5)->select();

        $this->title = $store['name'];
        $this->seoKey($store);
        $this->display();
    }


}